package com.itheima.controller;

import com.aliyuncs.exceptions.ClientException;
import com.itheima.domain.dto.LonginDto;
import com.itheima.domain.vo.LoginVo;
import com.itheima.domain.vo.Result;
import com.itheima.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/** Login-登录管理
 * @author 上官徵羽
 * @version 1.0
 * @since 2025-08-31 16:10
 */
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private LoginService loginService;

    /** 登录 */
    @PostMapping
    public Result login(@RequestBody LonginDto loginDto) throws ClientException {
        LoginVo loginVo = loginService.login(loginDto);
        return Result.success(loginVo);
    }


}
